package br.com.sgc.entities.financeiro;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import br.com.sgc.entities.geral.Clinica;

@Entity
@Table(schema="financeiro")
public class Caixa implements Serializable{

	private static final long serialVersionUID = 7029543214911453504L;
	
	@Id 
	@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ")
	@SequenceGenerator(schema = "financeiro", initialValue = 1, name = "SEQ", sequenceName = "financeiro.seq_caixa", allocationSize = 1)
	private Long id;
	
	@Temporal(TemporalType.DATE)
	private Date dataCaixa;
	
	@Column(name = "saldo_anterior")
	private BigDecimal saldoAnterior = new BigDecimal(0.0);
	
	@Column(name = "saldo_atual")
	private BigDecimal saldoAtual = new BigDecimal(0.0);
	
	private Boolean fechado;
	
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "clinica_id")
	private Clinica clinica;

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public Date getDataCaixa() {
		return dataCaixa;
	}

	public void setDataCaixa(Date dataCaixa) {
		this.dataCaixa = dataCaixa;
	}

	public BigDecimal getSaldoAnterior() {
		return saldoAnterior;
	}

	public void setSaldoAnterior(BigDecimal saldoAnterior) {
		this.saldoAnterior = saldoAnterior;
	}

	public BigDecimal getSaldoAtual() {
		return saldoAtual;
	}

	public void setSaldoAtual(BigDecimal saldoAtual) {
		this.saldoAtual = saldoAtual;
	}

	public Boolean getFechado() {
		return fechado;
	}

	public void setFechado(Boolean fechado) {
		this.fechado = fechado;
	}

	public Clinica getClinica() {
		return clinica;
	}

	public void setClinica(Clinica clinica) {
		this.clinica = clinica;
	}
}
